unify(controlbar): Merge and move ControlBar and related code to core#2849
unify(controlbar): Merge and move ControlBar and related code to core#2849stephanmeesters wants to merge 3 commits into
Conversation
95571e0 to
da28ca7
Compare
|
| Filename | Overview |
|---|---|
| Core/GameEngine/CMakeLists.txt | Uncomments all ControlBar headers and source files so they are compiled as part of Core; straightforward mirror of changes in the game-specific CMakeLists files. |
| Core/GameEngine/Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp | New file in Core (migrated from Generals); adds #ifdef RTS_GENERALS for building max-count tooltip, hides cost for free items, and adds prerequisite-science check for upgrade buttons. Logic looks correct. |
| Generals/Code/GameEngine/CMakeLists.txt | Comments out all ControlBar files previously compiled in Generals, delegating to Core; correct counterpart to the Core CMakeLists change. |
| GeneralsMD/Code/GameEngine/CMakeLists.txt | Comments out all ControlBar files for Zero Hour as well, aligning with Core; symmetric to the Generals change. |
| Core/GameEngineDevice/CMakeLists.txt | Uncomments W3DControlBar.cpp in Core's device layer so the rendering-specific control bar callback is compiled from Core instead of game-specific directories. |
| scripts/cpp/unify_move_files.py | Marks ControlBar file group as already migrated (unify_file calls commented out) and comments out a prior MessageStream block; correctly prevents re-application of the move. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
Core["Core/GameEngine\nCMakeLists.txt\n(ControlBar files ENABLED)"]
CoreDev["Core/GameEngineDevice\nCMakeLists.txt\n(W3DControlBar.cpp ENABLED)"]
GenEng["Generals/Code/GameEngine\nCMakeLists.txt\n(ControlBar files DISABLED)"]
GenDev["Generals/Code/GameEngineDevice\nCMakeLists.txt\n(W3DControlBar.cpp DISABLED)"]
MDEng["GeneralsMD/Code/GameEngine\nCMakeLists.txt\n(ControlBar files DISABLED)"]
MDDev["GeneralsMD/Code/GameEngineDevice\nCMakeLists.txt\n(W3DControlBar.cpp DISABLED)"]
CB["ControlBar\n.h/.cpp files\n(Core sources)"]
W3D["W3DControlBar.cpp\n(Core device source)"]
PopupNew["ControlBarPopupDescription.cpp\n(Core, new features:\n- cost hidden if free\n- prereq science check\n- #ifdef RTS_GENERALS tooltip)"]
Core -->|"compiles"| CB
Core -->|"compiles"| PopupNew
CoreDev -->|"compiles"| W3D
GenEng -.->|"delegates to Core"| CB
GenDev -.->|"delegates to Core"| W3D
MDEng -.->|"delegates to Core"| CB
MDDev -.->|"delegates to Core"| W3D
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
Core["Core/GameEngine\nCMakeLists.txt\n(ControlBar files ENABLED)"]
CoreDev["Core/GameEngineDevice\nCMakeLists.txt\n(W3DControlBar.cpp ENABLED)"]
GenEng["Generals/Code/GameEngine\nCMakeLists.txt\n(ControlBar files DISABLED)"]
GenDev["Generals/Code/GameEngineDevice\nCMakeLists.txt\n(W3DControlBar.cpp DISABLED)"]
MDEng["GeneralsMD/Code/GameEngine\nCMakeLists.txt\n(ControlBar files DISABLED)"]
MDDev["GeneralsMD/Code/GameEngineDevice\nCMakeLists.txt\n(W3DControlBar.cpp DISABLED)"]
CB["ControlBar\n.h/.cpp files\n(Core sources)"]
W3D["W3DControlBar.cpp\n(Core device source)"]
PopupNew["ControlBarPopupDescription.cpp\n(Core, new features:\n- cost hidden if free\n- prereq science check\n- #ifdef RTS_GENERALS tooltip)"]
Core -->|"compiles"| CB
Core -->|"compiles"| PopupNew
CoreDev -->|"compiles"| W3D
GenEng -.->|"delegates to Core"| CB
GenDev -.->|"delegates to Core"| W3D
MDEng -.->|"delegates to Core"| CB
MDDev -.->|"delegates to Core"| W3D
Reviews (2): Last reviewed commit: "unify(controlbar): Move ControlBar files..." | Re-trigger Greptile
xezon
left a comment
There was a problem hiding this comment.
Fixed a Base Generals HUD regression where the Generals Powers shortcut bar could disappear
How did Generals regress?
| descrip.concat( TheGameText->fetch( "TOOLTIP:TooltipCannotBuildUnitBecauseMaximumNumber" ) ); | ||
| if ( thingTemplate->isKindOf( KINDOF_STRUCTURE ) ) | ||
| { | ||
| descrip.concat( TheGameText->fetch( "TOOLTIP:TooltipCannotBuildBuildingBecauseMaximumNumber" ) ); |
There was a problem hiding this comment.
This tool tip string does not exist in Generals and therefore will show placeholder text now.
There was a problem hiding this comment.
Will now show the "unit already exists" text again using #ifdef RTS_GENERALS (see 2nd commit)
| win = TheWindowManager->winGetWindowFromId( nullptr, TheNameKeyGenerator->nameToKey( "GeneralsExpPoints.wnd:GenExpParent" ) ); | ||
| if(win) | ||
| { | ||
| win->winSetEnabledImage(0,m_powerPurchaseImage); |
There was a problem hiding this comment.
m_powerPurchaseImage will be null here in Generals. Is this ok?
There was a problem hiding this comment.
Can confirm putting nullptr in win->winSetEnabledImage is safe
This was already fixed in #2680, removed from description |
da28ca7 to
acdcd4d
Compare
Merge by rebase
Rebased and diffs checked in WinMerge. Re-applied the move with the script.
Changes to Generals
FROM_COMMAND_CENTERtoFROM_SHORTCUT)Showed building-specific max-count tooltip text.Todo